package example;

import java.util.Scanner;

public class Test_090417_01 {

	public static void main(String[] args) {
		Scanner s1 = new Scanner(System.in);
		System.out.print("Enter a String:");
		String aString = s1.next();
		StringBuffer result = new StringBuffer();
		for (int i = 0; i < aString.length(); i++) {

			if (aString.charAt(i) >= 'a' && aString.charAt(i) <= 'z') {
				result.append(Character.toUpperCase(aString.charAt(i)));
			} else if (aString.charAt(i) >= 'A' && aString.charAt(i) <= 'Z') {
				result.append(Character.toLowerCase(aString.charAt(i)));
			} else {
				System.out.println("\'" + aString.charAt(i)
						+ "\' is not a Letter.It won't be changed.");
				result.append(aString.charAt(i));
			}
		}
		System.out.println("Before conveting case: " + aString
				+ "\nAfter conveting case: " + result);
	}
}
